﻿@model IEnumerable<RedSand.Site.Models.NewsFullInfo>
@if (Model != null)
{
    foreach (var items in Model)
    {
    <div class="item-news">
        <h3 class="title clearfix">
            @Html.Action("feGenerateTitleLink", new { alias = items.Alias, category = items.CategoryID, title = items.Title })
            @Html.Action("feGenerateActionLink", new { alias = items.Alias, action = "edit", userid = items.UserID })
            @Html.Action("feGenerateActionLink", new { alias = items.Alias, action = "delete", userid=items.UserID })
        </h3>
        <div class="list-category">
            Category : @Html.Action("feGenerateCategoryLink", "Category", new { Category = items.CategoryID })
        </div>
        @if(!string.IsNullOrWhiteSpace(items.Image)) {
            <a class="avatar-link" href="#">
                <img alt="@items.Alias" src="@items.Image" class="avatar-news" />
            </a>
        }
        <div class="description-news">
            @items.Description
        </div>
        <div class="info-news clearfix">
            <span class="user">@items.Username</span>
        </div>
    </div>  
    }
    <div class="pager-wrapper clearfix">
        @Html.Pager("index", "home", "page", 1, 5, (int)ViewBag.TotalRecord, 7, PagerMode.NextPrevNumeric, (object)ViewBag.RouteValues, null)
    </div>
}
else
{
    <div class="item-news">
        <h3 class="title">
            Data empty!</h3>
        <h4>
            Please try again with another keyword or search using the categories</h4>
    </div> 
}
